<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    body {
        font-family: Helvetica, Arial, sans-serif;
        font-size: 12px;
      }
      
      h1 {
        font-size: 1.5em;
      }
      h2 {
        font-size: 1.2em;
      }
    </style>
</head>
<body>
    <p>this is the text in a p tag</p>
    <h1>some text here</h1>
    <h2>and another text here</h2>
    <a href="#" id="size-12">12</a>
    <a href="#" id="size-14">14</a>    
    <a href="#" id="size-16">16</a>    
</body>
</html>
<script>
     function makeSizer(size) {
        return function() {
            document.body.style.fontSize = size + 'px';
        };
    }
    var size12 = makeSizer(12);
    var size14 = makeSizer(14);
    var size16 = makeSizer(16);
    console.log(document.getElementById('size-12'))
    document.getElementById('size-12').onclick = size12;
    document.getElementById('size-14').onclick = size14;
    document.getElementById('size-16').onclick = size16;
</script>